<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ page import="java.io.BufferedReader" %>
    <%@ page import="net.sf.json.*" %>
 <%
 
 BufferedReader in=request.getReader();
 StringBuffer jsonStr=new StringBuffer();
 String str="";
 while((str=in.readLine())!=null){
	 jsonStr.append(str);
 }
 
 JSONObject jsonObj= JSONObject.fromObject(jsonStr.toString());
 String name= jsonObj.getString("userName");
 String pwd= jsonObj.getString("passWord");
 String msg="";
 if(name.equals("Tom")){
	 msg="登录成功";
 }else
 {
	 msg="登录失败";
 }
 
 response.getWriter().write(msg); 
 
 %>